package com.gaohe.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gaohe.pojo.Classes;
import com.gaohe.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClassesMapper extends BaseMapper<Classes> {

    List<Classes> getByUserId(Long userId);
    @Select("SELECT u.* from `user` u, classes c ,user_class uc \n" +
            "WHERE u.id = uc.user_id\n" +
            "AND c.id = uc.class_id\n" +
            "and c.id = #{id};")
    List<User> getUserByClassesId(Long id);
}
